﻿<UserControl x:Class="Epi.WPF.Dashboard.Controls.CloseButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Controls="clr-namespace:Epi.WPF.Dashboard.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             MouseEnter="PathX_MouseEnter" MouseLeave="PathX_MouseLeave" MouseLeftButtonUp="PathX_MouseLeftButtonUp"
             >
    <UserControl.Resources>

        <LinearGradientBrush x:Key="brushRedOrange" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="OrangeRed" Offset="0" />
                    <GradientStop Color="DarkRed" Offset="1" />
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="brushWhiteTransparent" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="transparent" Offset="0" />
                    <GradientStop Color="#44ffffff" Offset="1" />
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>

        </LinearGradientBrush>
        <Style x:Key="closeRectangle" TargetType="Rectangle">
            <Setter Property="Fill" Value="{StaticResource brushRedOrange}"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="closeRectangleHover" TargetType="Rectangle">
            <Setter Property="Fill" Value="PeachPuff"/>
            <Setter Property="Stroke" Value="{StaticResource brushWhiteTransparent}"/>
        </Style>

        <Style x:Key="closeX" TargetType="Path">
            <Setter Property="Stroke" Value="White"/>
        </Style>

        <Style x:Key="closeXHover" TargetType="Path">
            <Setter Property="Stroke" Value="Maroon"/>
        </Style>
    </UserControl.Resources>
    <Grid Grid.Column="5" Name="grdErrorIcon" Width="16" Height="16" Margin="1" Visibility="Visible">
        <Rectangle x:Name="closeRectangle1" Style="{StaticResource closeRectangle}" />
        <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1" >
            <Rectangle.ToolTip>
                <ToolTip x:Name="toolTipClose">Closes the gadget.</ToolTip>
            </Rectangle.ToolTip>
            <Rectangle.Fill>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="white" Offset="0" />
                            <GradientStop Color="transparent" Offset="1" />
                        </GradientStopCollection>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Path x:Name="pathX" Style="{StaticResource closeX}" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Data="M 200,0 L 0,200 M 0,0 L 200,200"/>
    </Grid>
</UserControl>
